﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StudentsAssignment
{

    public class PathNodeComparer : Comparer<PathNode>
    {
        public override int Compare(PathNode left, PathNode right)
        {
            return Comparer<float>.Default.Compare(left.estimated_cost, right.estimated_cost);
            /*
            if (left.estimated_cost > right.estimated_cost)
            {
                return -1;
            }
            else
            {
                return 1;
            }*/
        }
    }

    class PathFinder
    {
        SortedSet<PathNode> open_list = new SortedSet<PathNode>();

        public void open_list_add(PathNode node)
        {
            open_list.Add(node);

        }

        public bool open_list_empty()
        {
            return open_list.Count == 0;
        }

        public void open_list_clear()
        {
            open_list.Clear();
        }

        public PathNode open_list_top()
        {
            return open_list.First();
        }

        public void open_list_remove_top()
        {
            open_list.Remove(open_list.First());
        }
    }
}
